package org.example.memora.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.example.memora.entity.CommunityJoinApplication;

import java.util.List;

public interface CommunityJoinApplicationMapper extends BaseMapper<CommunityJoinApplication> {

    int insert(CommunityJoinApplication application);

    Long  selectCommunityIdById(@Param("id") Long id);

    CommunityJoinApplication selectByCommunityIdAndUserId(@Param("communityId") Long communityId,
                                                          @Param("userId") Long userId);

    List<CommunityJoinApplication> selectPendingByCommunityId(@Param("communityId") Long communityId);

    int updateStatus(@Param("id") Long id, @Param("status") String status);

    Long selectUserIdById(Long applicationId);
}

